{include file="$header" /}
<div class="mk-app-warp">
    <mk-table
        url="adminUser/index"
        save-url="adminUser/save"
        update-url="adminUser/update"
        delete-url="adminUser/delete"
        :date-search="false"
        :field="field">
    </mk-table>
</div>
{include file="$component" /}
<script>
    new Vue({
        el: '#app',
        data() {
            return {
                field: [
                    {
                        prop: 'cover', 
                        label: '资料', 
                        type: 'image', 
                        form: false,
                        width: '300px',
                        table: [{prop: 'account',label: ''},{prop: 'email',label: ''},{prop: 'nickname',label: ''}],
                    },
                    {
                        prop: 'account', 
                        label: '账号', 
                        rules: {required: true, max: 40, pattern: /^[^\u4e00-\u9fa5]+$/, message: '不能包含中文字符'},
                        table: false,
                    },
                    {
                        prop: 'group_id', 
                        label: '组别', 
                        type: 'select', 
                        option: tree.convertString({:json_encode($group)}), 
                        tree: true, 
                        props:{label: 'title', value: 'id'}, 
                        rules: {required: true},
                        default: [], 
                        disabled: true,
                        width: '150px',
                        sortable: 'custom', 
                    },
                    {
                        prop: 'nickname', 
                        label: '昵称', 
                        rules: {required: true, max: 255},
                        table: false,
                    },
                    {
                        prop: 'email', 
                        label: '邮箱', 
                        rules: {required: true, max: 255, type: 'email', message: '请输入正确的邮箱地址'},
                        table: false,
                    },
                    {
                        prop: 'password', 
                        label: '密码', 
                        placeholder: '不修改密码则此处为空',
                        rules: {saveRequired: true},
                        table: false, 
                    },
                    {
                        prop: 'sex', 
                        label: '性别', 
                        type: 'select', 
                        option: [{'title':'男','value':0},{'title':'女','value':1}], 
                        default: 0, 
                        props:{label: 'title', value: 'value'},
                        table: false, 
                    },
                    {
                        prop: 'status', 
                        label: '状态',  
                        type: 'switch', 
                        default: 1, 
                    },
                    {
                        prop: 'field', 
                        label: '', 
                        type: 'field', 
                        default: {:json_encode($field)}, 
                        table: false
                    },
                ],
            }
        },
    })
</script>
{include file="$footer" /}